package com.sjk.flink.exeception;

/**
 * @author SAMA
 */
public class BaseException extends RuntimeException{

    private static final long serialVersionUID = 1L;

    private String code;
    private String message;

    public BaseException(String errorCode, String errorMessage) {
        super(errorCode);
        this.code = errorCode;
        this.message = errorMessage;
    }

    public BaseException(String errorMessage) {
        super(errorMessage);
        this.message = errorMessage;
    }

    public BaseException(ErrorCode errorCode) {
        super(errorCode.getCode());
        this.code = errorCode.getCode();
        this.message = errorCode.getMsg();
    }



    public String getCode() {
        return code;
    }

    @Override
    public String getMessage() {
        return message;
    }
}
